final String tableNote = 't_note';
final String columnId = '_id';
final String columnContent = 'content';
final String columnTs = 'ts';

class Note {
  int id;
  String content;
  int ts;

  Note();

  Map<String, dynamic> toMap() {
    var map = <String, dynamic>{columnContent: content, columnTs: ts};
    if (id != null) {
      map[columnId] = id;
    }
    return map;
  }

  Note.fromMap(Map<String, dynamic> map) {
    id = map[columnId];
    content = map[columnContent];
    ts = map[columnTs];
  }

  static List<Note> fromList(dynamic mapList) {
    List<Note> list = new List(mapList.length);
    for (int i = 0; i < mapList.length; i++) {
      list[i] = Note.fromMap(mapList[i]);
    }
    return list;
  }
}
